import React, { Component } from 'react';
import {connect} from 'dva'

import './App.css';

class App extends Component {
  test(){
    //this.props.dispatch({type:'home/changeNum',payload:{num:2}});
  }
  test2(){
    this.props.dispatch({type:'home/func',payload:{num:4}});
  }
  render() {
    return (
      <div className="App">
        DVA牛逼
        {this.props.num}
        <button onClick={e=>{this.test()}}>CHANGE</button>
        <button onClick={e=>{this.test2()}}>CHANGE2</button>
      </div>
    );
  }
}
const mapStateProps = (state) =>{
  return{
    num:state.home.num
  }
}
export default connect(mapStateProps)(App);
